package com.ultrawise.survey.module.surevybase.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ultrawise.survey.core.base.BaseService;
import com.ultrawise.survey.module.surevybase.dao.TSurveyLogPublishDAO;

@Service("tSurveyLogPublishService")
public class TSurveyLogPublishService extends BaseService {

	@Autowired
	TSurveyLogPublishDAO tSurveyLogPublishDAO;

	public Map<String,Object> getLastPub(String sy_id) {
		String sql ="select * from t_survey_log_publish where SY_ID="+sy_id+" order by CREATETIME desc LIMIT 1";
		Object ob = null;
		try{
		 ob = tSurveyLogPublishDAO.getJdbcTemplate().queryForMap(sql);
		}catch(Exception e){
			//e.printStackTrace();
			return null;
		}
		return (ob!=null)?(Map<String,Object>)ob:null;
	}

}